package c.c.b.b.e;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.text.TextUtils;
import c.c.b.b.g.b;
import com.huawei.hms.android.HwBuildEx.VersionCodes;
import java.util.HashMap;
import java.util.Map;

/* compiled from: TNCManager */
public class f implements c {
    public static f p;
    public long a = 0;
    public boolean b = false;
    public Context c;
    public e d;
    public int e = 0;
    public long f = 19700101000L;
    public int g = 0;
    public HashMap<String, Integer> h = new HashMap();
    public HashMap<String, Integer> i = new HashMap();
    public int j = 0;
    public HashMap<String, Integer> k = new HashMap();
    public HashMap<String, Integer> l = new HashMap();
    public boolean m = true;
    public Map<String, Integer> n = new HashMap();
    public Handler o = new a(Looper.getMainLooper());

    /* compiled from: TNCManager */
    public class a extends Handler {
        public a(Looper looper) {
            super(looper);
        }

        public void handleMessage(Message message) {
            if (message.what == VersionCodes.CUR_DEVELOPMENT) {
                boolean z = message.arg1 != 0;
                f fVar = f.this;
                d g = fVar.g();
                if (g != null) {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append("doUpdateRemote, ");
                    stringBuilder.append(z);
                    String str = "TNCManager";
                    b.a(str, stringBuilder.toString());
                    long elapsedRealtime = SystemClock.elapsedRealtime();
                    if (!z) {
                        if ((((long) g.k) * 1000) + fVar.a > elapsedRealtime) {
                            b.a(str, "doUpdateRemote, time limit");
                            return;
                        }
                    }
                    fVar.a = elapsedRealtime;
                    c.c.b.b.b.a.a(fVar.c).h(b.i.b.f.w(fVar.c));
                }
            }
        }
    }

    public static synchronized f a() {
        f fVar;
        synchronized (f.class) {
            if (p == null) {
                p = new f();
            }
            fVar = p;
        }
        return fVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:27:0x0060  */
    /* JADX WARNING: Removed duplicated region for block: B:37:0x00ac  */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x0099  */
    public java.lang.String b(java.lang.String r8) {
        /*
        r7 = this;
        r0 = android.text.TextUtils.isEmpty(r8);
        if (r0 != 0) goto L_0x0125;
    L_0x0006:
        r0 = "/network/get_network";
        r0 = r8.contains(r0);
        if (r0 != 0) goto L_0x0125;
    L_0x000e:
        r0 = "/get_domains/v4";
        r0 = r8.contains(r0);
        if (r0 != 0) goto L_0x0125;
    L_0x0016:
        r0 = "/ies/speed";
        r0 = r8.contains(r0);
        if (r0 == 0) goto L_0x0020;
    L_0x001e:
        goto L_0x0125;
    L_0x0020:
        r0 = 0;
        r1 = new java.net.URL;	 Catch:{ all -> 0x0031 }
        r1.<init>(r8);	 Catch:{ all -> 0x0031 }
        r2 = r1.getProtocol();	 Catch:{ all -> 0x0031 }
        r0 = r1.getHost();	 Catch:{ all -> 0x002f }
        goto L_0x0036;
    L_0x002f:
        r1 = move-exception;
        goto L_0x0033;
    L_0x0031:
        r1 = move-exception;
        r2 = r0;
    L_0x0033:
        r1.printStackTrace();
    L_0x0036:
        r1 = android.text.TextUtils.isEmpty(r2);
        if (r1 != 0) goto L_0x0125;
    L_0x003c:
        r1 = "http";
        r1 = r1.equals(r2);
        if (r1 != 0) goto L_0x004c;
    L_0x0044:
        r1 = "https";
        r1 = r1.equals(r2);
        if (r1 == 0) goto L_0x0125;
    L_0x004c:
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 == 0) goto L_0x0054;
    L_0x0052:
        goto L_0x0125;
    L_0x0054:
        r1 = r7.h();
        r3 = 0;
        r4 = "handleHostMapping, TNC host faild num over limit: ";
        r5 = "TNCManager";
        if (r1 != 0) goto L_0x0060;
    L_0x005f:
        goto L_0x0097;
    L_0x0060:
        r1 = r1.get(r0);
        r1 = (java.lang.String) r1;
        r6 = android.text.TextUtils.isEmpty(r1);
        if (r6 != 0) goto L_0x0097;
    L_0x006c:
        r6 = r7.n;
        r6 = r6.get(r1);
        if (r6 != 0) goto L_0x0075;
    L_0x0074:
        goto L_0x0097;
    L_0x0075:
        r6 = r7.n;
        r1 = r6.get(r1);
        r1 = (java.lang.Integer) r1;
        r1 = r1.intValue();
        r6 = 3;
        if (r1 < r6) goto L_0x0097;
    L_0x0084:
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r1.append(r4);
        r1.append(r0);
        r1 = r1.toString();
        c.c.b.b.g.b.a(r5, r1);
        r3 = 1;
    L_0x0097:
        if (r3 == 0) goto L_0x00ac;
    L_0x0099:
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r1.append(r4);
        r1.append(r0);
        r0 = r1.toString();
        c.c.b.b.g.b.a(r5, r0);
        return r8;
    L_0x00ac:
        r1 = r7.h();
        if (r1 == 0) goto L_0x0111;
    L_0x00b2:
        r3 = r1.containsKey(r0);
        if (r3 != 0) goto L_0x00b9;
    L_0x00b8:
        goto L_0x0111;
    L_0x00b9:
        r1 = r1.get(r0);
        r1 = (java.lang.String) r1;
        r3 = android.text.TextUtils.isEmpty(r1);
        if (r3 == 0) goto L_0x00c6;
    L_0x00c5:
        return r8;
    L_0x00c6:
        r3 = new java.lang.StringBuilder;
        r3.<init>();
        r4 = "handleHostMapping, match, origin: ";
        r3.append(r4);
        r3.append(r8);
        r3 = r3.toString();
        c.c.b.b.g.b.a(r5, r3);
        r3 = new java.lang.StringBuilder;
        r3.<init>();
        r3.append(r2);
        r4 = "://";
        r3.append(r4);
        r3.append(r0);
        r0 = r3.toString();
        r1 = c.b.a.a.a.E(r2, r4, r1);
        r2 = r8.startsWith(r0);
        if (r2 == 0) goto L_0x00fc;
    L_0x00f8:
        r8 = r8.replaceFirst(r0, r1);
    L_0x00fc:
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = "handleHostMapping, target: ";
        r0.append(r1);
        r0.append(r8);
        r0 = r0.toString();
        c.c.b.b.g.b.a(r5, r0);
        return r8;
    L_0x0111:
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r2 = "handleHostMapping, nomatch: ";
        r1.append(r2);
        r1.append(r0);
        r0 = r1.toString();
        c.c.b.b.g.b.a(r5, r0);
    L_0x0125:
        return r8;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.b.b.e.f.b(java.lang.String):java.lang.String");
    }

    /* JADX WARNING: Removed duplicated region for block: B:80:0x017b  */
    /* JADX WARNING: Missing block: B:89:0x01e6, code skipped:
            return;
     */
    public synchronized void c(c.c.b.b.f.c r10, c.c.b.b.f.p r11) {
        /*
        r9 = this;
        monitor-enter(r9);
        if (r11 != 0) goto L_0x0005;
    L_0x0003:
        monitor-exit(r9);
        return;
    L_0x0005:
        r0 = r9.m;	 Catch:{ all -> 0x01e7 }
        if (r0 != 0) goto L_0x000b;
    L_0x0009:
        monitor-exit(r9);
        return;
    L_0x000b:
        r0 = r9.c;	 Catch:{ all -> 0x01e7 }
        r0 = b.i.b.f.w(r0);	 Catch:{ all -> 0x01e7 }
        if (r0 != 0) goto L_0x0015;
    L_0x0013:
        monitor-exit(r9);
        return;
    L_0x0015:
        r0 = 0;
        r1 = new java.net.URL;	 Catch:{ Exception -> 0x0021 }
        r2 = r10.getUrl();	 Catch:{ Exception -> 0x0021 }
        r1.<init>(r2);	 Catch:{ Exception -> 0x0021 }
        r0 = r1;
        goto L_0x0022;
    L_0x0022:
        if (r0 != 0) goto L_0x0026;
    L_0x0024:
        monitor-exit(r9);
        return;
    L_0x0026:
        r1 = r0.getProtocol();	 Catch:{ all -> 0x01e7 }
        r2 = r0.getHost();	 Catch:{ all -> 0x01e7 }
        r0 = r0.getPath();	 Catch:{ all -> 0x01e7 }
        r10 = r10.getIpAddrStr();	 Catch:{ all -> 0x01e7 }
        r3 = r11.h;	 Catch:{ all -> 0x01e7 }
        r4 = (int) r3;	 Catch:{ all -> 0x01e7 }
        r3 = "http";
        r3 = r3.equals(r1);	 Catch:{ all -> 0x01e7 }
        if (r3 != 0) goto L_0x004b;
    L_0x0041:
        r3 = "https";
        r3 = r3.equals(r1);	 Catch:{ all -> 0x01e7 }
        if (r3 != 0) goto L_0x004b;
    L_0x0049:
        monitor-exit(r9);
        return;
    L_0x004b:
        r3 = android.text.TextUtils.isEmpty(r10);	 Catch:{ all -> 0x01e7 }
        if (r3 == 0) goto L_0x0053;
    L_0x0051:
        monitor-exit(r9);
        return;
    L_0x0053:
        r3 = "TNCManager";
        r5 = new java.lang.StringBuilder;	 Catch:{ all -> 0x01e7 }
        r5.<init>();	 Catch:{ all -> 0x01e7 }
        r6 = "onResponse, url: ";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r1);	 Catch:{ all -> 0x01e7 }
        r6 = "://";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r2);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r10);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r4);	 Catch:{ all -> 0x01e7 }
        r5 = r5.toString();	 Catch:{ all -> 0x01e7 }
        c.c.b.b.g.b.a(r3, r5);	 Catch:{ all -> 0x01e7 }
        r3 = r9.g();	 Catch:{ all -> 0x01e7 }
        if (r3 == 0) goto L_0x008e;
    L_0x0087:
        r5 = r3.b;	 Catch:{ all -> 0x01e7 }
        if (r5 == 0) goto L_0x008e;
    L_0x008b:
        r9.d(r11, r2);	 Catch:{ all -> 0x01e7 }
    L_0x008e:
        if (r3 != 0) goto L_0x0092;
    L_0x0090:
        monitor-exit(r9);
        return;
    L_0x0092:
        r11 = "TNCManager";
        r5 = new java.lang.StringBuilder;	 Catch:{ all -> 0x01e7 }
        r5.<init>();	 Catch:{ all -> 0x01e7 }
        r6 = "onResponse, url matched: ";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r1);	 Catch:{ all -> 0x01e7 }
        r6 = "://";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r2);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r10);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5.append(r4);	 Catch:{ all -> 0x01e7 }
        r6 = " ";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.g;	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.h;	 Catch:{ all -> 0x01e7 }
        r6 = r6.size();	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.i;	 Catch:{ all -> 0x01e7 }
        r6 = r6.size();	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = " ";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.j;	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.k;	 Catch:{ all -> 0x01e7 }
        r6 = r6.size();	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = "#";
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r6 = r9.l;	 Catch:{ all -> 0x01e7 }
        r6 = r6.size();	 Catch:{ all -> 0x01e7 }
        r5.append(r6);	 Catch:{ all -> 0x01e7 }
        r5 = r5.toString();	 Catch:{ all -> 0x01e7 }
        c.c.b.b.g.b.a(r11, r5);	 Catch:{ all -> 0x01e7 }
        if (r4 <= 0) goto L_0x01e5;
    L_0x010e:
        r11 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;
        r5 = 0;
        r6 = 1;
        if (r4 < r11) goto L_0x011a;
    L_0x0114:
        r11 = 400; // 0x190 float:5.6E-43 double:1.976E-321;
        if (r4 >= r11) goto L_0x011a;
    L_0x0118:
        r11 = 1;
        goto L_0x011b;
    L_0x011a:
        r11 = 0;
    L_0x011b:
        if (r11 == 0) goto L_0x0145;
    L_0x011d:
        r10 = r9.g;	 Catch:{ all -> 0x01e7 }
        if (r10 > 0) goto L_0x0125;
    L_0x0121:
        r10 = r9.j;	 Catch:{ all -> 0x01e7 }
        if (r10 <= 0) goto L_0x0128;
    L_0x0125:
        r9.i();	 Catch:{ all -> 0x01e7 }
    L_0x0128:
        r10 = android.text.TextUtils.isEmpty(r2);	 Catch:{ all -> 0x01e7 }
        if (r10 == 0) goto L_0x0130;
    L_0x012e:
        goto L_0x01e5;
    L_0x0130:
        r10 = r9.n;	 Catch:{ all -> 0x01e7 }
        r10 = r10.containsKey(r2);	 Catch:{ all -> 0x01e7 }
        if (r10 != 0) goto L_0x013a;
    L_0x0138:
        goto L_0x01e5;
    L_0x013a:
        r10 = r9.n;	 Catch:{ all -> 0x01e7 }
        r11 = java.lang.Integer.valueOf(r5);	 Catch:{ all -> 0x01e7 }
        r10.put(r2, r11);	 Catch:{ all -> 0x01e7 }
        goto L_0x01e5;
    L_0x0145:
        r11 = 100;
        if (r4 < r11) goto L_0x0178;
    L_0x0149:
        r11 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
        if (r4 < r11) goto L_0x014e;
    L_0x014d:
        goto L_0x0178;
    L_0x014e:
        r11 = r9.g();	 Catch:{ all -> 0x01e7 }
        if (r11 == 0) goto L_0x0176;
    L_0x0154:
        r7 = r11.m;	 Catch:{ all -> 0x01e7 }
        r7 = android.text.TextUtils.isEmpty(r7);	 Catch:{ all -> 0x01e7 }
        if (r7 != 0) goto L_0x0176;
    L_0x015c:
        r11 = r11.m;	 Catch:{ all -> 0x01e7 }
        r7 = new java.lang.StringBuilder;	 Catch:{ all -> 0x01e7 }
        r7.<init>();	 Catch:{ all -> 0x01e7 }
        r8 = "";
        r7.append(r8);	 Catch:{ all -> 0x01e7 }
        r7.append(r4);	 Catch:{ all -> 0x01e7 }
        r7 = r7.toString();	 Catch:{ all -> 0x01e7 }
        r11 = r11.contains(r7);	 Catch:{ all -> 0x01e7 }
        if (r11 == 0) goto L_0x0176;
    L_0x0175:
        goto L_0x0178;
    L_0x0176:
        r11 = 0;
        goto L_0x0179;
    L_0x0178:
        r11 = 1;
    L_0x0179:
        if (r11 != 0) goto L_0x01e5;
    L_0x017b:
        r11 = r9.j;	 Catch:{ all -> 0x01e7 }
        r11 = r11 + r6;
        r9.j = r11;	 Catch:{ all -> 0x01e7 }
        r11 = r9.k;	 Catch:{ all -> 0x01e7 }
        r6 = java.lang.Integer.valueOf(r5);	 Catch:{ all -> 0x01e7 }
        r11.put(r0, r6);	 Catch:{ all -> 0x01e7 }
        r11 = r9.l;	 Catch:{ all -> 0x01e7 }
        r0 = java.lang.Integer.valueOf(r5);	 Catch:{ all -> 0x01e7 }
        r11.put(r10, r0);	 Catch:{ all -> 0x01e7 }
        r11 = r9.j;	 Catch:{ all -> 0x01e7 }
        r0 = r3.h;	 Catch:{ all -> 0x01e7 }
        if (r11 < r0) goto L_0x01e2;
    L_0x0198:
        r11 = r9.k;	 Catch:{ all -> 0x01e7 }
        r11 = r11.size();	 Catch:{ all -> 0x01e7 }
        r0 = r3.i;	 Catch:{ all -> 0x01e7 }
        if (r11 < r0) goto L_0x01e2;
    L_0x01a2:
        r11 = r9.l;	 Catch:{ all -> 0x01e7 }
        r11 = r11.size();	 Catch:{ all -> 0x01e7 }
        r0 = r3.j;	 Catch:{ all -> 0x01e7 }
        if (r11 < r0) goto L_0x01e2;
    L_0x01ac:
        r11 = "TNCManager";
        r0 = new java.lang.StringBuilder;	 Catch:{ all -> 0x01e7 }
        r0.<init>();	 Catch:{ all -> 0x01e7 }
        r3 = "onResponse, url doUpdate: ";
        r0.append(r3);	 Catch:{ all -> 0x01e7 }
        r0.append(r1);	 Catch:{ all -> 0x01e7 }
        r1 = "://";
        r0.append(r1);	 Catch:{ all -> 0x01e7 }
        r0.append(r2);	 Catch:{ all -> 0x01e7 }
        r1 = "#";
        r0.append(r1);	 Catch:{ all -> 0x01e7 }
        r0.append(r10);	 Catch:{ all -> 0x01e7 }
        r10 = "#";
        r0.append(r10);	 Catch:{ all -> 0x01e7 }
        r0.append(r4);	 Catch:{ all -> 0x01e7 }
        r10 = r0.toString();	 Catch:{ all -> 0x01e7 }
        c.c.b.b.g.b.a(r11, r10);	 Catch:{ all -> 0x01e7 }
        r10 = 0;
        r9.e(r5, r10);	 Catch:{ all -> 0x01e7 }
        r9.i();	 Catch:{ all -> 0x01e7 }
    L_0x01e2:
        r9.f(r2);	 Catch:{ all -> 0x01e7 }
    L_0x01e5:
        monitor-exit(r9);
        return;
    L_0x01e7:
        r10 = move-exception;
        monitor-exit(r9);
        throw r10;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.b.b.e.f.c(c.c.b.b.f.c, c.c.b.b.f.p):void");
    }

    /* JADX WARNING: Removed duplicated region for block: B:30:0x00a9  */
    /* JADX WARNING: Removed duplicated region for block: B:29:0x00a8 A:{RETURN} */
    public final void d(c.c.b.b.f.p r12, java.lang.String r13) {
        /*
        r11 = this;
        r0 = r11.m;
        if (r0 != 0) goto L_0x0005;
    L_0x0004:
        return;
    L_0x0005:
        r0 = 0;
        r12 = r12.b;
        if (r12 == 0) goto L_0x001a;
    L_0x000a:
        r12 = r12.h;
        if (r12 != 0) goto L_0x000f;
    L_0x000e:
        goto L_0x001a;
    L_0x000f:
        r1 = "tnc-cmd";
        r12 = r12.get(r1);
        r12 = (java.lang.String) r12;
        if (r12 == 0) goto L_0x001a;
    L_0x0019:
        r0 = r12;
    L_0x001a:
        r12 = android.text.TextUtils.isEmpty(r0);
        r1 = "TNCManager";
        if (r12 == 0) goto L_0x0037;
    L_0x0022:
        r12 = new java.lang.StringBuilder;
        r12.<init>();
        r0 = "handleTncProbe, no probeProto, ";
        r12.append(r0);
        r12.append(r13);
        r12 = r12.toString();
        c.c.b.b.g.b.a(r1, r12);
        return;
    L_0x0037:
        r12 = "@";
        r0 = r0.split(r12);
        if (r0 == 0) goto L_0x0109;
    L_0x003f:
        r2 = r0.length;
        r3 = 2;
        if (r2 == r3) goto L_0x0045;
    L_0x0043:
        goto L_0x0109;
    L_0x0045:
        r2 = 1;
        r3 = 0;
        r5 = 0;
        r6 = r0[r5];	 Catch:{ all -> 0x0058 }
        r6 = java.lang.Integer.parseInt(r6);	 Catch:{ all -> 0x0058 }
        r0 = r0[r2];	 Catch:{ all -> 0x0056 }
        r7 = java.lang.Long.parseLong(r0);	 Catch:{ all -> 0x0056 }
        goto L_0x0072;
    L_0x0056:
        r0 = move-exception;
        goto L_0x005a;
    L_0x0058:
        r0 = move-exception;
        r6 = 0;
    L_0x005a:
        r0.printStackTrace();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r7 = "handleTncProbe, probeProto except, ";
        r0.append(r7);
        r0.append(r13);
        r0 = r0.toString();
        c.c.b.b.g.b.a(r1, r0);
        r7 = r3;
    L_0x0072:
        r0 = "handleTncProbe, local: ";
        r0 = c.b.a.a.a.g(r0);
        r9 = r11.e;
        r0.append(r9);
        r0.append(r12);
        r9 = r11.f;
        r0.append(r9);
        r9 = " svr: ";
        r0.append(r9);
        r0.append(r6);
        r0.append(r12);
        r0.append(r7);
        r12 = " ";
        r0.append(r12);
        r0.append(r13);
        r0 = r0.toString();
        c.c.b.b.g.b.a(r1, r0);
        r9 = r11.f;
        r0 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1));
        if (r0 > 0) goto L_0x00a9;
    L_0x00a8:
        return;
    L_0x00a9:
        r11.e = r6;
        r11.f = r7;
        r0 = r11.c;
        r9 = "ttnet_tnc_config";
        r0 = r0.getSharedPreferences(r9, r5);
        r0 = r0.edit();
        r5 = "tnc_probe_cmd";
        r0 = r0.putInt(r5, r6);
        r5 = "tnc_probe_version";
        r0 = r0.putLong(r5, r7);
        r0.apply();
        r0 = r11.e;
        r5 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320;
        if (r0 != r5) goto L_0x0108;
    L_0x00ce:
        r0 = r11.g();
        if (r0 != 0) goto L_0x00d5;
    L_0x00d4:
        return;
    L_0x00d5:
        r5 = new java.util.Random;
        r6 = java.lang.System.currentTimeMillis();
        r5.<init>(r6);
        r0 = r0.l;
        if (r0 <= 0) goto L_0x00eb;
    L_0x00e2:
        r0 = r5.nextInt(r0);
        r3 = (long) r0;
        r5 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
        r3 = r3 * r5;
    L_0x00eb:
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r5 = "handleTncProbe, updateConfig delay: ";
        r0.append(r5);
        r0.append(r3);
        r0.append(r12);
        r0.append(r13);
        r12 = r0.toString();
        c.c.b.b.g.b.a(r1, r12);
        r11.e(r2, r3);
    L_0x0108:
        return;
    L_0x0109:
        r12 = new java.lang.StringBuilder;
        r12.<init>();
        r0 = "handleTncProbe, probeProto err, ";
        r12.append(r0);
        r12.append(r13);
        r12 = r12.toString();
        c.c.b.b.g.b.a(r1, r12);
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.b.b.e.f.d(c.c.b.b.f.p, java.lang.String):void");
    }

    public final void e(boolean z, long j) {
        if (!this.o.hasMessages(VersionCodes.CUR_DEVELOPMENT)) {
            Message obtainMessage = this.o.obtainMessage();
            obtainMessage.what = VersionCodes.CUR_DEVELOPMENT;
            obtainMessage.arg1 = z;
            if (j > 0) {
                this.o.sendMessageDelayed(obtainMessage, j);
            } else {
                this.o.sendMessage(obtainMessage);
            }
        }
    }

    public final void f(String str) {
        if (!TextUtils.isEmpty(str)) {
            Map h = h();
            if (h != null && h.containsValue(str)) {
                if (this.n.get(str) == null) {
                    this.n.put(str, Integer.valueOf(1));
                } else {
                    this.n.put(str, Integer.valueOf(((Integer) this.n.get(str)).intValue() + 1));
                }
            }
        }
    }

    public d g() {
        e eVar = this.d;
        return eVar != null ? eVar.b : null;
    }

    public Map<String, String> h() {
        d g = g();
        return g != null ? g.d : null;
    }

    public final void i() {
        b.a("TNCManager", "resetTNCControlState");
        this.g = 0;
        this.h.clear();
        this.i.clear();
        this.j = 0;
        this.k.clear();
        this.l.clear();
    }
}
